package web.verification.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import web.verification.interceptor.ParamInterceptor;

/**
 * 资源配置
 *
 * @author shishaolong
 * @datatime 2020/11/30 14:45
 */
@Configuration
public class VerificationConfig implements WebMvcConfigurer {

    @Autowired
    private ParamInterceptor paramInterceptor;

    /**
     * 自定义拦截规则
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(paramInterceptor).addPathPatterns("/**");
    }
}
